package com.chumi.bootstrap.controller.tsys;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.chumi.bootstrap.model.standard.tsys.TSysUser;
import com.chumi.bootstrap.service.tsys.TSysUserService;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.llsfw.core.controller.base.BaseController;

@Controller
public class TSysUserController extends BaseController {

    /**
     * <p>
     * Field log: 日志
     * </p>
     */
    private static final Logger LOG = LogManager.getLogger();

    @Autowired
    private TSysUserService tsus;
    
    @RequestMapping("/getUserList")
	@ResponseBody
    public List<TSysUser> getUserList(HttpServletRequest request) throws IOException{
    	List<TSysUser> userlist = tsus.selectUser();
    	
    	//ObjectMapper jsonobj = new ObjectMapper();
    	  
    	
		return userlist; 
    }
    
    @RequestMapping("/selectUserList")
	@ResponseBody
    public String selectUserList(HttpServletRequest request) throws IOException{
    	List<TSysUser> userlist = tsus.selectUser();
    	
    	ObjectMapper jsonobj = new ObjectMapper();
    	  
    	
		return jsonobj.writeValueAsString(userlist); 
    }

}
